﻿#region Copyright
/// <copyright company="CSZI.com">
/// ------------------------------------------------------------------------------
/// Copyright (c) 2002-2010 Chaos Studio.  All rights reserved.
/// Contact   :   MSN:zhouyu@cszi.com , QQ:478779122 .
/// Link         :   http://www.CSZI.com , http://www.69sea.com
/// Author     :   zhouyu(周宇)
/// ------------------------------------------------------------------------------
/// </copyright>
#endregion

using System;
using System.Xml.Serialization;


namespace CS.Task.DataTransfer
{
    /// <summary>
    /// 
    /// </summary>
    ///
    /// <description class = "CS.Task.DataTransfer.ExtendInfo">  
    /// </description> 
    ///
    /// <history>
    /// Create      :	atwind , 2010-6-1 9:29:43 ;
    ///  </history>
    [Serializable,
    XmlRoot(ElementName = "extend")]
    public class ExtendInfo
    {
        public ExtendInfo()
        {
            OriginDb = new DatabaseInfo { ConnectionString = "OriginDb ConnectionString", PrepareSql = "PreSql", OperateSql = "Opsql" };
            DestinationDb = new DatabaseInfo { ConnectionString = "DestinationDb ConnectionString", PrepareSql = "PreSql", OperateSql = "Opsql" };
        }

        /// <summary>
        /// 源数据库
        /// </summary>
        public DatabaseInfo OriginDb { get; set; }

        /// <summary>
        /// 目标数据库
        /// </summary>
        public DatabaseInfo DestinationDb { get; set; }

    }

    /// <summary>
    /// 数据相关信息
    /// </summary>
    [Serializable]
    public class DatabaseInfo
    {
        /// <summary>
        /// 数据库类型
        /// </summary>
        [XmlAttribute("style")]
        public DbStyleType Style { get; set; }

        /// <summary>
        /// 连接字符串
        /// </summary>
        [XmlAttribute("connectionString")]
        public string ConnectionString { get; set; }

        /// <summary>
        /// 准备语句
        /// </summary>
        public string PrepareSql { get; set; }

        /// <summary>
        /// 操作语句
        /// </summary>
        public string OperateSql { get; set; }

    }

    /// <summary>
    /// 数据库类型
    /// </summary>
    public enum DbStyleType
    {
        /// <summary>
        /// MSSqlServer数据库
        /// </summary>
        SqlServer = 0,

        /// <summary>
        /// MySql数据库
        /// </summary>
        MySql = 1,

        /// <summary>
        /// Oracle数据库
        /// </summary>
        Oracle = 2,

    }

    /// <summary>
    /// 数据库所处位置
    /// </summary>
    public enum DbStatusType
    {
        /// <summary>
        /// 源，起点
        /// </summary>
        Origin = 0,

        /// <summary>
        /// 目标，目的地，终点
        /// </summary>
        Destination = 1,
    }

 

}
